from sklearn.preprocessing import MinMaxScaler
import numpy as np
from sklearn.impute import SimpleImputer

data = np.array([[ 1., -1.,  2.],
                 [ 2.,  0.,  0.],
                 [ 0.,  1., -1.]])

imp = SimpleImputer(missing_values=np.nan, strategy='mean')  # 创建按列均值填充策略对象
Fdata=imp.fit_transform(data) #返回填充后的数据集Fdata

scaler = MinMaxScaler()
scaler_data = scaler.fit_transform(Fdata)